home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / wb / czesc_2 / fakedeficon / fakedeficon.readme < prev   
Text File  |  1994-06-07  |  9KB  |  192 lines

  1.                          *-*-*-*-*-*-*-*-*-*-*-*-*
  2.                          | Fake WB Default Icons |
  3.                          *-*-*-*-*-*-*-*-*-*-*-*-*
  4.  
  5.                                 Version 0.1
  6.  
  7. The contents of this archive are Copyright (c) 1994, Jason R. Hulance.  The
  8. archive may be freely distributed so long as it remains complete and is not
  9. altered.
  10.  
  11.  
  12.  Introduction
  13. *-*-*-*-*-*-*-*
  14.  
  15. The "FakeDefIcon" program provides full and flexible file type recognition
  16. and automatic tool usage for files which have no icons.  It does this by
  17. patching several system routines and fooling Workbench.
  18.  
  19. Fake, 'pseudo' icons are used by Workbench (Release 2 and greater) for files
  20. which have no icons, when the 'Show All Files' option is used.  The
  21. "FakeDefIcon" program redirects Workbench to use different icons according
  22. to the type of the icon-less file.  For example, it can recognise an IFF
  23. ILBM and will fake a nice(?) picture icon for it, rather than the normal
  24. Workbench pseudo project or tool icon.  However, these icons are still
  25. pseudo icons, so the supplied icon's default tool is not run when the icon
  26. is double-clicked, rather the 'Execute a File' requester appears as normal.
  27. All is not lost, though, as "FakeDefIcon" intercepts the 'Execute a File'
  28. requester and fills in the command line with the appropriate tool and
  29. arguments.
  30.  
  31. This may seem a little strange, making the process two stage (i.e., three
  32. mouse clicks), but it has the benefit of letting the user change their mind
  33. about which tool to run.  For example, a GIF picture might be set up to run
  34. "Multiview" with a 'SCREEN' argument by default.  It is then a simple matter
  35. of a single keystroke (in the 'Execute a File' requester) to eliminate the
  36. 'SCREEN' argument if the user changes their mind and wants the picture on,
  37. say, the Workbench screen.
  38.  
  39. You can also use "FakeDefIcon" without faking icons!  In this case you get
  40. the normal pseudo icons, but the 'Execute a File' requester is still filled
  41. in properly for you.
  42.  
  43.  Requirements
  44. *-*-*-*-*-*-*-*
  45.  
  46. "FakeDefIcon" works under v37 and v39 of Workbench (that's Release 2 and 3,
  47. to some people).  I'm not sure about newer versions, although I guess
  48. Workbench won't change too much... Maybe one day it will have file typing as
  49. standard.  (It definitely won't work under Release 1.3, by the way!)
  50.  
  51. The "whatis.library" is required.  If you don't already have it then it
  52. should be available from the same place you found this!  I left it out of
  53. this archive in order to keep the size down, and because a lot of people
  54. already have it.  (The "whatis.library" is Copyright S.R. & P.C.)
  55.  
  56. To run this program from the 'Startup-Sequence' you will need a "RUNBACK"
  57. program.
  58.  
  59.  
  60.  Installation
  61. *-*-*-*-*-*-*-*
  62.  
  63. 1) Copy the executable "FakeDefIcon" somewhere, preferably on your path
  64.    (e.g., the C: directory).
  65. 2) Make sure you have the "whatis.library" in your LIBS: (else download it
  66.    from somewhere).  You might like to take a look at the 'FileTypes' file
  67.    in the S directory of this archive, since it supplies ICONNAMEs for some
  68.    of the existing types that don't already have them.  If you want to use
  69.    this file then copy it to your S: directory.
  70. 3) Copy the icons in the Icons directory to 'ENVARC:sys', by doing something
  71.    like this:
  72.                    COPY Icons/#? ENVARC:sys
  73.  
  74. 4) Now, either reboot or copy the icons to 'ENV:sys', too.  Either way you
  75.    will end up with the icons in 'ENV:sys' where they need to be.
  76.  
  77. You can now run the program.  Be careful because it patches system routines
  78. and does *NOT* check that they can be safely unpatched if you want to stop
  79. the program.  If you run "FakeDefIcon" from the Shell/CLI then you can press
  80. Ctrl-C to unload/stop it.  Otherwise you need to use the BREAK command.
  81.  
  82. If you like the program then you might like to run it from the
  83. 'Startup-Sequence'.  It is best to do this by putting the following command
  84. in the 'User-Startup' file in your S: directory
  85.  
  86.     RUNBACK >NIL: FakeDefIcon
  87.  
  88. You can unload it by using the "STATUS" command to find the process and then
  89. using "BREAK" in the normal way.
  90.  
  91.  
  92.  Options
  93. *-*-*-*-*
  94.  
  95. The "FakeDefIcon" program has the following options: NOFAKE/S,DEBUG/N.
  96. The 'NOFAKE' option turns off the faking of pseudo icons, but the 'Execute a
  97. File' editing remains.  The 'DEBUG' option needs a number to be specified:
  98. zero means no debugging (the default), one means that "FakeDefIcon" will
  99. tell you about the files it can't find a type for, two means that it will
  100. tell you about the types it can't find icons for, and three means it will
  101. tell you about both.  The debugging option may be useful when you're setting
  102. up your own S:FileTypes file for the "whatis.library".
  103.  
  104. Because "FakeDefIcon" is written in Amiga E it can also be run from the
  105. Workbench.
  106.  
  107.  
  108.  Default Tools and Tool Types
  109. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  110.  
  111. The icons in ENV:sys can have default tools and tool types to specify the
  112. tool used by the "FakeDefIcon" program.  For example, the icon for plain
  113. text files ('def_text.info') may have the default tool "More".  In this case
  114. 'FakeDefIcon' will fill in the 'Execute a File' requester by prefixing the
  115. file name with "More".  Clicking on the OK gadget will then run "More" on
  116. the text file.
  117.  
  118. As well as the default tool you can specify arguments to be passed to the
  119. tool using the 'PRE_ARGS' and 'POST_ARGS' tooltypes.  For example, the icon
  120. for a GIF file ('def_GIF.info') may have the default tool "Multiview" and a
  121. 'PRE_ARGS=SCREEN' tooltype.  In this case the argument 'SCREEN' will precede
  122. the file name in the 'Execute a File' requester.  (Pressing Ctrl-W will
  123. erase the word 'SCREEN' in the requester, if you want the picture to appear
  124. on the Workbench screen.)
  125.  
  126. Another example is the icon for Lharc (or LHA) archives.  This may have the
  127. default tool "lha", a 'PRE_ARGS=-m e' tooltype and a 'POST_ARGS=Ram:'
  128. tooltype.  "FakeDefIcon" will then create, in the 'Execute a File'
  129. requester, the command line:
  130.  
  131.    lha -m e fred.lha ram:
  132.  
  133. for a file 'fred.lha' (with no real icon).
  134.  
  135. The icons in the archive have default tools and tooltypes set up how I have
  136. them, but you are free to change them how you like.  And don't think you're
  137. stuck with the supplied icon images -- use your faves from MagicWB etc. if
  138. you want.
  139.  
  140.  
  141.  Out-troduction
  142. *-*-*-*-*-*-*-*-*
  143.  
  144. This is a first, test release.  If other people find them useful then I'll
  145. try to support them and maybe make "FakeDefIcon" a lot faster (it's very
  146. slow at the moment, mainly due to the list it needs to access in a sorted
  147. way).  The installation etc. could also do with some tidying up, but it's
  148. not worth it if no-one uses this!
  149.  
  150. I wrote these programs because Icon 1.0 by Olaf 'Olsen' Barthel of MXM (way
  151. back in 1990!, and on an old Fish Disk), and all other similar programs
  152. (most recently IconManager by Alex Taylor), don't work properly.  The
  153. problem is that Workbench does not work in the most convenient way.  In
  154. particular, the way these programs know that Workbench is going to want
  155. default icons is by looking at the menu strip and seeing if 'Show All Files'
  156. is checked.  This would be fine if Workbench checked this flag before it
  157. started looking, but unfortunately it does it after it's finished looking.
  158. This is why you need to do frequent 'Updates' to get these programs to
  159. display their fake icons properly (for instance, if you go from a drawer
  160. with 'Show Only Icons' to a drawer inside this that has 'Show All Files').
  161. My 'FakeDefIcon' program *ALWAYS* supplies fake icons properly, since it
  162. catches the Workbench calls to open 'def_project' and the like.  The only
  163. pain in the neck is that Workbench sorts its list of icon-less files...
  164.  
  165. If you find that "FakeDefIcon" is too slow (e.g., you're a floppy user with
  166. directories with loads of files) then you might like to just use the
  167. 'NOFAKE' option, and be surprised(?) when it shows you the file is really a
  168. JPEG picture when the 'Execute a File' requester pops up.
  169.  
  170.  
  171.  Blatant Plug
  172. *-*-*-*-*-*-*-*
  173.  
  174. The source to this program is *not* a good example of Amiga E!!!  It is
  175. horribly hacked and try to reuse variables too much (cautious about the
  176. Workbench stack that they run on).  But don't let this put you off
  177. investigating Amiga E, the super-fast language designed and implemented by
  178. Wouter van Oortmerssen.  The current version is 2.1b, it's Public Domain and
  179. it's very well supported (try the Amiga E mailing list, mail a SUBSCRIBE or
  180. HELP request to "amigae-request@bkhouse.cts.com").  A new version (3.0) is
  181. on the way, soon, and is going to be amazing from all current indications.
  182.  
  183.  
  184.  Contact
  185. *-*-*-*-*
  186.  
  187. E-mail with your complaints, suggestions etc. at:
  188.  
  189.       jason@fsel.com
  190. or
  191.       m88jrh@ecs.ox.ac.uk
  192.